using System;

namespace Present.Commands.Extensions
{
    public static class DisposableExtensions
    {
        /// <summary>
        /// null checks before disposing of an object
        /// </summary>
        /// <param name="reference">object to call dispose on</param>
        public static void NullDispose(this IDisposable reference)
        {
            if (reference != null)
                reference.Dispose();
        }
    }
}